package com.hxh.component.business.ui.face;
/**
 * Created by hxh on 2017/8/19.
 */

import android.os.Parcel;
import android.os.Parcelable;

import java.util.HashMap;
import java.util.Map;

/**
 * 创建者：hxh
 * 时间：  2017/8/19
 * 描述：
 */
public class FaceIDDataStructBean implements Parcelable {
    public String delta;
    public Map<String, byte[]> images = new HashMap();

    public FaceIDDataStructBean() {
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.delta);
        dest.writeInt(this.images.size());
        for (Map.Entry<String, byte[]> entry : this.images.entrySet()) {
            dest.writeString(entry.getKey());
            dest.writeByteArray(entry.getValue());
        }
    }

    protected FaceIDDataStructBean(Parcel in) {
        this.delta = in.readString();
        int imagesSize = in.readInt();
        this.images = new HashMap<String, byte[]>(imagesSize);
        for (int i = 0; i < imagesSize; i++) {
            String key = in.readString();
            byte[] value = in.createByteArray();
            this.images.put(key, value);
        }
    }

    public static final Creator<FaceIDDataStructBean> CREATOR = new Creator<FaceIDDataStructBean>() {
        @Override
        public FaceIDDataStructBean createFromParcel(Parcel source) {
            return new FaceIDDataStructBean(source);
        }

        @Override
        public FaceIDDataStructBean[] newArray(int size) {
            return new FaceIDDataStructBean[size];
        }
    };
}
